package offer;

import java.util.Arrays;
import java.util.Collections;

public class Solution {
    public int minNumberInRotateArray(int[] array) {
        int l = 0, r = array.length - 1;
        while (l < r) {
            if (r - l == 1) {
                return Math.min(array[l], array[r]);
            }
            int mid = (l + r) / 2;
            if (array[mid] < array[l] && array[mid] < array[r]) {
                r=mid;
            } else {
                if (array[l] < array[r]) {
                    r = mid;
                } else {
                    l = mid;
                }
            }
        }
        return array[l];

    }

    public static void main(String[] args) {
        Integer b=null;
        System.out.println(b==1);
        System.out.println((Integer)null);
    }
    public static int[] roate(int[] nums,int n){
        int[] result=new int[nums.length];
        System.arraycopy(nums,n,result,0,nums.length-n);
        System.arraycopy(nums,0,result,nums.length-n,n);
        return result;
    }
}
